import type { InterviewQuestionsSearch } from '@/models/InterviewQuestions/InterviewQuestionsSearch'
import { reactive } from 'vue'

export function useInterviewQuestionsSearchFormState() {
  const formState = reactive<Partial<InterviewQuestionsSearch>>({
    id: undefined,
    isDeleted: undefined,
    title: undefined,
    answer: undefined,
    classification: undefined,
    secondaryClassification: undefined,
  })
  function resetFormState() {
    formState.id = undefined
    formState.isDeleted = undefined
    formState.title = undefined
    formState.answer = undefined
    formState.classification = undefined
    formState.secondaryClassification = undefined
  }
  function setFormState(formData: Partial<InterviewQuestionsSearch>) {
    formState.id = formData.id
    formState.isDeleted = formData.isDeleted
    formState.title = formData.title
    formState.answer = formData.answer
    formState.classification = formData.classification
    formState.secondaryClassification = formData.secondaryClassification
  }

  return { formState, resetFormState, setFormState }
}
